﻿@{  
    ViewData.TemplateInfo.HtmlFieldPrefix = ViewData.TemplateInfo.HtmlFieldPrefix.Replace(ViewData.ModelMetadata.PropertyName, "").Trim('.');
    var propertyName = ViewData["name"] == null ? ViewData.ModelMetadata.PropertyName : ViewData["name"].ToString(); 
}
<tr>
    <th>
        @if (IsSectionDefined("Label"))
        { 
            @RenderSection("Label", false)
        }
        else
        {
            <label for="@ViewData.TemplateInfo.GetFullHtmlFieldId(propertyName)">
                @ViewData.ModelMetadata.GetDisplayName().Localize()</label>           
        }
    </th>
    <td>
        @RenderBody()       
    </td>
</tr>
